<template>
	<view class="home">
		<image :src="img" class="top"></image>
		<image :src="img_details" class="detail"></image>;
	</view>
</template>

<script>
	export default {
		data() {
			return {
				img: '',
				img_details: ''
			}
		},
		onLoad(e) {
			console.log(e.id);
			this.getFood(e.id)
		},
		methods: {
			getFood(id) {
				uni.request({
					url: 'https://www.xinyixjc.com/miniapp/api/getFoodById',
					data: {
						id: id
					},
					method: 'GET'
				}).then((res) => {
					this.img = res.data.data.url;
					this.img_details = res.data.data.urlDetails
					console.log(res);
				});
			}
		}
	}
</script>

<style>
	.detail{
		width: 100%;
		height: 2554px;
	}
	.home{
		width: 100%;
		height: 2554px;
	}
</style>
